package forms;

import java.util.Date;

import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;

import org.hibernate.validator.constraints.NotBlank;
import org.springframework.format.annotation.DateTimeFormat;

import domain.Gallery;
import domain.Money;

public class PaintingForm {

	//Constructor
	public PaintingForm(){
		super();
	}
	
	//Attributes
	private String title;
	private String author;
	private Date date;
	private Money appraisal;
	
	private int paintingId;
	private Gallery gallery;
	
	@NotBlank
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	@NotBlank
	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}
	
	@NotNull
	@Past
	@Temporal(TemporalType.TIMESTAMP)
	@DateTimeFormat(pattern = "dd/MM/yyyy HH:mm")
	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}
	
	@Valid
	@NotNull
	public Money getAppraisal() {
		return appraisal;
	}

	public void setAppraisal(Money appraisal) {
		this.appraisal = appraisal;
	}
	public int getPaintingId() {
		return paintingId;
	}
	public void setPaintingId(int paintingId) {
		this.paintingId = paintingId;
	}
	
	public Gallery getGallery() {
		return gallery;
	}
	public void setGallery(Gallery gallery) {
		this.gallery = gallery;
	}
	
}
